package com.bright.cwduijie.duijie.repository;

import com.bright.cwduijie.duijie.pojo.po.DuijieAsync;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

public interface DuijieAsyncRepository extends JpaRepository<DuijieAsync, Integer>, JpaSpecificationExecutor<DuijieAsync> {

    Optional<DuijieAsync> getDuijieAsyncByMethodNoAndTaskId(String methodNo, String taskId);

//    @Query("select methodNo, type, taskId, sjjhbz, writeLog, createDate, writeDate, batchId, taskState, accSet from DuijieAsync where sjjhbz=:sjjhbz")
//    List<DuijieAsync> getBySjjhbz(@Param("sjjhbz") int sjjhbz);

    List<DuijieAsync> getBySjjhbz(int sjjhbz);

    List<DuijieAsync> getAllByBatchId(String batchId);
}